package com.platform.service;

import com.platform.dao.ApiGoodsMapper;
import com.platform.entity.GoodsVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;
import java.util.Map;


@Service
public class ApiGoodsService {
    @Autowired
    private ApiGoodsMapper goodsDao;

    //中大团队扩展
    public GoodsVo queryObjectWithLevel(Map<String, Object> map) { return goodsDao.queryObjectWithLevel(map); }

    //中大团队扩展
    public int queryTotalByDeptId(Map<String, Object> map) { return goodsDao.queryTotalByDeptId(map); }

    public GoodsVo queryObject(Integer id) {
        return goodsDao.queryObject(id);
    }


    public List<GoodsVo> queryList(Map<String, Object> map) {
        return goodsDao.queryList(map);
    }

    public List<GoodsVo> queryGoodsList(Integer good_id) {
        return goodsDao.queryGoodsList(good_id);
    }

    /**
     * 中大团队扩展
     * 根据父类ID获取相关商品列表
     * @param map
     * @return
     */
    public List<GoodsVo> queryListCascade(Map<String, Object> map) {
        return goodsDao.queryListCascade(map);
    }


    public List<GoodsVo> queryListBySameCategory(Map<String, Object> map) {
        return goodsDao.queryListBySameCategory(map);
    }

    public int queryTotal(Map<String, Object> map) {
        return goodsDao.queryTotal(map);
    }


    public void save(GoodsVo goods) {
        goodsDao.save(goods);
    }


    public void update(GoodsVo goods) {
        goodsDao.update(goods);
    }

    //中大团队扩展
    public void updateCollageNum(GoodsVo goodsVo) { goodsDao.updateCollageNum(goodsVo); }

    public void delete(Integer id) {
        goodsDao.delete(id);
    }


    public void deleteBatch(Integer[] ids) {
        goodsDao.deleteBatch(ids);
    }

    public List<GoodsVo> queryHotGoodsList(Integer root_dept_id, Integer access_user_grade, Integer offset, Integer limit) {
        return goodsDao.queryHotGoodsList(root_dept_id, access_user_grade, offset, limit);
    }

    public List<GoodsVo> queryNewGoodsList(Integer root_dept_id, Integer access_user_grade, Integer offset, Integer limit) {
        return goodsDao.queryNewGoodsList(root_dept_id, access_user_grade, offset, limit);
    }

    public List<GoodsVo> queryCollageGoodsList(Integer root_dept_id, Integer access_user_grade, Date now, Integer offset, Integer limit) {
        return goodsDao.queryCollageGoodsList(root_dept_id, access_user_grade, now, offset, limit);
    }

    public List<GoodsVo> queryFuturesGoodsList(Integer root_dept_id, Integer access_user_grade, Date now, Integer offset, Integer limit) {
        return goodsDao.queryFuturesGoodsList(root_dept_id, access_user_grade, now, offset, limit);
    }

    public List<GoodsVo> queryCategoryList(Integer root_dept_id, Integer access_user_grade,List categoryIds) {
        return goodsDao.queryCategoryList(root_dept_id, access_user_grade, categoryIds);
    }

    public List<GoodsVo> queryCatalogProductList(Map<String, Object> map) {
        return goodsDao.queryCatalogProductList(map);
    }
}
